import request from '@/utils/request'

export function getTeachers(pageSize, pageNumber) {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.queryTeacherInfo.biz.ext',
    // url: '/teachers/list',
    method: 'post',
    data: {
      'pageSize': pageSize,
      'pageNumber': pageNumber

    }
  })
}
export function getUserPersonnelInfo(username) {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.userPersonnelInfo.biz.ext',
    method: 'post',
    data: {
      'username': username
    }
  })
}
export function getTeachersWithFilter(pageSize, pageNumber, teacher_code, name, department_code, gender, teacher_type_code, status) {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.queryTeacherWithFilter.biz.ext',
    // URL: '/teacher/list',
    method: 'post',
    data: {
      'pageSize': pageSize,
      'pageNumber': pageNumber,
      'teacher_code': teacher_code,
      'name': name,
      'department_code': department_code,
      'gender': gender,
      'teacher_type_code': teacher_type_code,
      'status': status
    }
  })
}
export function updateTeacher(id, teacher_code, name, status) {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.updateTeacher.biz.ext',
    method: 'post',
    data: {
      'id': id,
      'teacher_code': teacher_code,
      'name': name,
      'status': status
    }
  })
}
export function updateUserPersonnelInfo(username, name, birthday, department_name, idcard, mobile_phone, email) {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.updateUserPersonnelInfo.biz.ext',
    method: 'post',
    data: {
      'username': username,
      'name': name,
      'birthday': birthday,
      'department_name': department_name,
      'idcard': idcard,
      'mobile_phone': mobile_phone,
      'email': email

    }
  })
}
export function importData() {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.importExcelToDataObject.biz.ext',
    method: 'post',
    data: {
    }
  })
}
export function synTeacher() {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.synTeacherProc.biz.ext',
    method: 'post'
  })
}
export function getClassroom(pageSize, pageNumber) {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.queryClassroom.biz.ext',
    method: 'post',
    data: {
      'pageSize': pageSize,
      'pageNumber': pageNumber

    }
  })
}
export function getClassroomWithFilter(pageSize, pageNumber, campus_code, house_code, floor) {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.queryClassroomWithFilter.biz.ext',
    method: 'post',
    data: {
      'pageSize': pageSize,
      'pageNumber': pageNumber,
      'campus_code': campus_code,
      'house_code': house_code,
      'floor': floor
    }
  })
}
export function getHouse(campus_code) {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.queryHouseByCampus.biz.ext',
    method: 'post',
    data: {
      'campus_code': campus_code
    }
  })
}
export function getFloor(house_code) {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.queryFloorByHouse.biz.ext',
    method: 'post',
    data: {
      'house_code': house_code
    }
  })
}
export function synClassrooms() {
  return request({
    url: 'exam/com.primeton.eos.teacherInfo.synClassroomProc.biz.ext',
    method: 'post'
  })
}
export function publishExaminationRules(title, content) {
  return request({
    url: 'exam/com.primeton.eos.tinymceExaminationRule.publishExaminationRule.biz.ext',
    method: 'post',
    data: {
      'title': title,
      'content': content
    }
  })
}
export function fetchExaminationRules() {
  return request({
    url: '/teachers/examinationRules',
    method: 'post'
  })
}
export function upgradeTeacher(teacher_code, roleId) {
  return request({
    url: '/teachers/upgrade',
    method: 'post',
    data: {
      'teacher_code': teacher_code,
      'roleId': roleId
    }
  })
}
export function getRoles() {
  return request({
    url: '/teachers/roleList',
    method: 'post',
    data: {
    }
  })
}
export function sendVerifyCode(mobile, verifyCode) {
  return request({
    url: '/teachers/verificationCode',
    method: 'post',
    data: {
      'mobile': mobile,
      'verifyCode': verifyCode
    }
  })
}
export function resetTeacherPassword(teacher_code) {
  return request({
    url: '/teachers/resetPassword',
    method: 'post',
    data: {
      'teacher_code': teacher_code
    }
  })
}
export function sendMessage(mobiles, message) {
  return request({
    url: '/teachers/sendMessage',
    method: 'post',
    data: {
      'mobiles': mobiles,
      'message': message
    }
  })
}
export function setNoticeProxy(ids, roleId) {
  return request({
    url: '/teachers/setNoticeProxy',
    method: 'post',
    data: {
      'ids': ids,
      'roleId': roleId
    }
  })
}
